<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Pacienti_model extends CI_Model {
	
	function get_patients() {
		$query = $this->db->from('Pacient')
				->join('Ubytovany', 'Ubytovany.Rodne_cislo = Pacient.Rodne_cislo')
				->where('Ubytovany.Oddelenie', $this->session->userdata('Oddelenie'))
				->get();
		
		return $query->result_array();
	}
	
	function get_diets() {
		$query = $this->db->select('Meno, ID')
						->from('Dieta')
						->get();
		
		return $query->result_array();
	}
}